<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<body>

<!--导航-->
<nav th:fragment="menu(index)" class="ui inverted attached segment head-tab-padding">
    <div class="ui container">
        <!--stackable 表示可堆叠，自适应-->
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item">管理后台</h2>
            <a class="menu-item item mobile-hide" href="#" th:href="@{/admin/blogs}"
               th:classappend="${index==0}?'active'"><i
                    class="teal code icon"></i>博客</a>
            <a class="menu-item item mobile-hide" href="#" th:href="@{/admin/category}"
               th:classappend="${index==1}?'active'"><i
                    class="teal idea icon"></i>分类</a>
            <a class="menu-item item mobile-hide" href="#" th:href="@{/admin/tags}"
               th:classappend="${index==2}?'active'"><i
                    class="teal tags icon"></i>标签</a>
            <a class="menu-item item mobile-hide" href="#" th:href="@{/admin/imgWall}"
               th:classappend="${index==3}?'active'"><i
                    class="teal images icon"></i>图库</a>

            <div class="right menu-item  mobile-hide menu">
                <div class="ui dropdown item">
                    <img class="ui circular image mini margin-r"
                         src="http://xxstudy.cn/media/img/avatar_15.png"
                         style="vertical-align:middle" alt="">
                    <span th:text="${user?.nickName}?:'唐人'">唐人</span>
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <a class="item"><i class="user icon"></i> 个人中心</a>
                        <a th:href="@{/admin/loginOut}" class="item"><i
                                class="sign-out alternate icon"></i>注销</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--菜单按钮-->
    <a id="menu-toggle" class=" ui black icon button bar-position mobile-show" href="#">
        <i class="sidebar icon"></i>
    </a>
</nav>

</body>
</html>